import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
 
  let defaultCity='重庆';
  defaultCity=localStorage.city ;
  
export default new Vuex.Store({
   state:{
       city:defaultCity
   },
   getters:{
       getCity(state){
           return state.city
       }
   },
   mutations:{
           changeCity(state,cityName){
           state.city=cityName;
           localStorage.city=cityName;
       }
   }
})